<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>步骤</title>
    <link rel="stylesheet" type="text/css" href="../../easyui/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="../../easyui/themes/icon.css"/>
    <link rel="stylesheet" type="text/css" href="../design.css"/>

    <script type="text/javascript" src="../../jquery/jquery.min.js"></script>
    <script type="text/javascript" src="../../jquery/env.js"></script>

    <script type="text/javascript" src="../../easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../plugins/step.js"></script>

</head>
<body>
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add'" onclick="unitDesign()">组件设计</a>
<div id="uu"></div>
<!--
<form>
    <div class="step-form-item">
        <input id="describe" class="easyui-textbox"
               data-options="width:600 ,label:'步骤名称',labelWidth:120,labelAlign:'right'">
    </div>
    <div class="step-form-item">
        <input id="db" class="easyui-textbox"
               data-options="width:600 ,label:'数据源',labelWidth:120,labelAlign:'right'">
    </div>

    <div class="step-form-item">
        <input id="sql" class="easyui-textbox"
               data-options="width:600,height:240,label:'SQL',labelWidth:120,labelAlign:'right',multiline:true">
    </div>

    <a class="easyui-linkbutton" data-options="" onclick="save()">保存</a>
</form>
-->

</body>
<script>
    function designSteps() {
        $.getJSON("../test/steps.json",function (data) {
            $.each(data.steps,function (i,step) {
                $('<div id="step_'+i+'"></div>').appendTo('body').step(step);

            });
        });

    }
    function addStep(astep) {
        astep = astep ||{
            "stepId": "ZXJ_MES_FMIT-fromsap-step1",
            "describe": "xml解析",
            "title": "xml解析",
            "unitType": "XML",
            "db": "zjk_db",
            "sql": "select 1 from dual",
        };
        $('<div id="step_"></div>').appendTo('body').step(astep);

    }
function unitDesign() {
    // addStep()
    designSteps()
}

    var data ={
      columns:['describe','db','sql'],
      url:{
          queryUrl:'',
          saveUrl:''
      },
    };
    function edit(stepUnit) {
        $('form').form('clear');
        $('#describe').textbox('setValue', stepUnit.describe);
        $('#db').textbox('setValue', stepUnit.db);
        $('#sql').textbox('setValue', stepUnit.sql);
        // $('#describe').textbox('initValue',stepUnit.describe)

    }

    function save() {
        console.log('submit')
        $('form').form('submit', {
            onSubmit: function (param) {
                console.log('param',param)
                var validate = $(this).form('validate');
                if (!validate) {
                    console.log('false')
                    return validate;
                }

                return false;

            }
        });

    }



</script>
</html>
